package io.coderyeah.ymcc.feign.fallback;

import feign.hystrix.FallbackFactory;
import io.coderyeah.ymcc.domain.Login;
import io.coderyeah.ymcc.feign.client.LoginServiceClient;
import io.coderyeah.ymcc.result.JSONResult;

/**
 * @author lqs
 * @date 2022/10/22 22:56
 */
public class LoginClientFallback implements FallbackFactory<LoginServiceClient> {
    @Override
    public LoginServiceClient create(Throwable throwable) {
        return new LoginServiceClient() {
            @Override
            public JSONResult saveOrUpdate(Login login) {
                throwable.printStackTrace();
                return JSONResult.error("服务器繁忙,请稍后再试哦");
            }
        };
    }
}
